package com.xgp.order.interceptor;

import feign.InvocationContext;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import feign.ResponseInterceptor;
import org.springframework.stereotype.Component;

import java.util.UUID;

@Component
public class XTokenRequestInterceptor implements
        RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        System.out.println("XTokenRequestInterceptor拦截器启动！！！");
        requestTemplate.header("X-Token", UUID.randomUUID().toString());
    }

//    @Override
//    public Object intercept(InvocationContext invocationContext, Chain chain) throws Exception {
//        return invocationContext;
//    }
}
